home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- //Borland C++Builder
- //Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
- //----------------------------------------------------------------------------
- //---------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include <sysdefs.h>
- #include "..\autosrv\srvr_tlb.h"
- #include "auto1.h"
- //---------------------------------------------------------------------
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent *Owner)
- : TForm(Owner)
- {
- try
- {
- AutoServer.BindDefault();
- EditServer = CoEditServer::Create();
- }
- catch (...)
- {
- ShowMessage("Please build and run the \\AutoSrv\\Srvr example before this one.");
- Application->Terminate();
- }
- }
- //---------------------------------------------------------------------
- void __fastcall TForm1::setvalDClick(TObject *Sender)
- {
- AutoServer.EditStr = WideString(Edit1->Text);
- }
- //---------------------------------------------------------------------
- void __fastcall TForm1::getvalDClick(TObject *Sender)
- {
- Edit1->Text = AutoServer.EditStr;
- }
- //---------------------------------------------------------------------
- void __fastcall TForm1::clearDClick(TObject *Sender)
- {
- // Call a server function
- AutoServer.Clear();
- }
- //---------------------------------------------------------------------
- void __fastcall TForm1::functionDClick(TObject *Sender)
- {
- WideString retval;
-
- AutoServer.SetThreeStr(WideString("one"),WideString("two"),
- WideString("three"), &retval);
- Edit1->Text = retval;
- }
- //---------------------------------------------------------------------------
-
-
- void __fastcall TForm1::setvalVClick(TObject *Sender)
- {
- //call the server's setter function
- EditServer->set_EditStr(WideString(Edit1->Text));
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm1::functionVClick(TObject *Sender)
- {
- WideString p1("This ");
- WideString p2("is a ");
- WideString p3("test.");
- WideString retval;
-
- // The [out, retval] parameter most come last.
- EditServer->SetThreeStr(p1, p2, p3, &retval);
- Edit1->Text = retval;
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm1::clearVClick(TObject *Sender)
- {
- // Call a server function
- EditServer->Clear();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::getvalVClick(TObject *Sender)
- {
- WideString str;
- EditServer->get_EditStr(&str);
- Edit1->Text = AnsiString(str);
- }
- //---------------------------------------------------------------------------
-